package com.jhgsys.internal.formDesign.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;


/**
 * 表单设计 Entity
 *
 * @author fenghaijun
 * @date 2024-08-28 10:54:00
 */
@Data
@TableName("form_design")
public class FormDesign implements Serializable {

    /**
     * 主键
     */
    @TableId(value = "design_id", type = IdType.ASSIGN_UUID)
    @Size(max = 32, message = "{noMoreThan}")
    private String designId;

    /**
     * 公司Id
     */
    @TableField("tenant_id")
    @NotBlank(message = "{required}")
    @Size(max = 32, message = "{noMoreThan}")
    private String tenantId;

    /**
     * 表单名称
     */
    @TableField("form_name")
    @NotBlank(message = "{required}")
    @Size(max = 255, message = "{noMoreThan}")
    private String formName;

    /**
     * 发布对象
     */
    @TableField("publish_object")
    @NotBlank(message = "{required}")
    @Size(max = 255, message = "{noMoreThan}")
    private String publishObject;

    /**
     * 开始时间
     */
    @TableField("start_date")
    @NotNull(message = "{required}")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date startDate;

    /**
     * 结束时间
     */
    @TableField("end_date")
    @NotNull(message = "{required}")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date endDate;

    /**
     * 表单设计
     */
    @TableField("form_html")
    @NotBlank(message = "{required}")
    @Size(max = 2147483647, message = "{noMoreThan}")
    private String formHtml;

    /**
     * 表单版本
     */
    @TableField("version")
    @NotNull(message = "{required}")
    private String version;

    /**
     * 是否未模板 0：否 1：是
     */
    @TableField("template_flg")
    @NotNull(message = "{required}")
    private String templateFlg;


    /**
     * 表单状态;1：待发布 2：已发布
     */
    @TableField("status")
    @NotBlank(message = "{required}")
    @Size(max = 2, message = "{noMoreThan}")
    private String status;

    /**
     * 新增人
     */
    @TableField("created_by")
    @Size(max = 32, message = "{noMoreThan}")
    private String createdBy;

    /**
     * 新增时间
     */
    @TableField("created_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createdTime;

    /**
     * 修改人
     */
    @TableField("updated_by")
    @Size(max = 32, message = "{noMoreThan}")
    private String updatedBy;

    /**
     * 修改时间
     */
    @TableField("updated_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updatedTime;

    /**
     * 删除人
     */
    @TableField("deleted_by")
    @Size(max = 32, message = "{noMoreThan}")
    private String deletedBy;

    /**
     * 删除时间
     */
    @TableField("deleted_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date deletedTime;

    /**
     * 删除标记
     */
    @TableField("deleted_flg")
    @Size(max = 1, message = "{noMoreThan}")
    private String deletedFlg;

}